
class coord_sys(object):
    def __init__(self, coord_type, equinox=None):
        self.coord_type=coord_type
        self.equinox = equinox

    def __hash__(self):
        return hash((self.coord_type, self.equinox))



FK5 = coord_sys("fk5", equinox=2433282.42345905) #pytpm.j2000
FK4 = coord_sys("fk4", equinox=2451545.0) # pytpm.b1950
GAL = coord_sys("galactic",
                equinox=2436204.3610493038 )  # astrodate.BesselDate(1958.0).jd)


def coord_system_guess(ctype1_name, ctype2_name, equinox):
    if ctype1_name.upper().startswith("RA") and \
       ctype2_name.upper().startswith("DEC"):
        if equinox == 2000.0:
            return FK5
        elif equinox == 1950.0:
            return FK4
        elif equinox is None:
            return FK5
        else:
            return None
    if ctype1_name.upper().startswith("GLAT") and \
       ctype2_name.upper().startswith("GLON"):
        return GAL
    return None
